﻿#region << 版 本 注 释 >>
/*----------------------------------------------------------------
 * 版权所有 (c) 2022   保留所有权利。
 * CLR版本：4.0.30319.42000
 * 机器名称：DESKTOP-UL84BU5
 * 公司名称：
 * 命名空间：KingerRobot.WanliMDC.Biz
 * 唯一标识：1d8baea4-32d8-441d-9202-3ce9a7fd5dad
 * 文件名：SwitchData
 * 当前用户域：DESKTOP-UL84BU5
 * 
 * 创建者：zzl
 * 电子邮箱：1003590782@qq.com
 * 创建时间：2022/6/2 16:00:46
 * 版本：V1.0.0
 * 描述：
 *
 * ----------------------------------------------------------------
 * 修改人：
 * 时间：
 * 修改说明：
 *
 * 版本：V1.0.1
 *----------------------------------------------------------------*/
#endregion << 版 本 注 释 >>
namespace KingerRobot.MexicoSailunMDC.Biz;

internal static class SwitchData
{
    public static string GetLineEquipStatus(int equipStatus) => equipStatus switch
    {
        0 => "自动",
        1 => "故障",
        2 => "有载",
        3 => "备用",
        4 => "备用",
        5 => "备用",
        6 => "备用",
        7 => "备用",
        8 => "任务结束",
        9 => "请求下发任务",
        10 => "空闲可卸货",
        11 => "有货需取货",
        12 => "备用",
        13 => "备用",
        14 => "备用",
        15 => "备用",
        _ => $"其他 {equipStatus}"
    };

    public static string GetLineErrorNo(int errorNo) => errorNo switch
    {
        1 => "进胎超时",
        2 => "出胎超时",
        3 => "上升超时",
        4 => "下降超时",
        5 => "x轴变频器故障",
        6 => "y轴变频器故障",
        15 => "光电故障",
        _ => $"其他警告 {errorNo}"
    };
    public static string GetEmsEquipStatus(int equipStatus) => equipStatus switch
    {
        1 => "运行中",
        2 => "空闲中",
        3 => "故障",
        4 => "未进入自动",
        _ => $"其他Ems { equipStatus }"
    };
    public static string GetEmsSign(int sign) => sign switch
    {
        0 => "桁架运行中",
        1 => "下位可读指令",
        2 => "上位可写指令",
        _ => $"其他Ems{sign}"
    };

    public static string GetStackerStatus(int status) => status switch
    {
        0 => "手动",
        1 => "自动",
        3 => "报警",
        4 => "网络故障",
        _ => $"其他状态 {status}"
    };

    public static string GetStackerAcceptCmd(int status) => status switch
    {
        1 => "可接受指令",
        0 => "不接受指令",
        _ => $"其他状态 {status}"
    };
    public static string GetLineErrByCode(int status) => status switch
    {
        2 => $"{status}电机故障",
        3 => $"{status}光电故障",
        4 => $"{status}数据丢失",
        5 => $"{status}超高",
        _ => $"{status}未知线体故障"
    };
    public static string QueryLineErrByCode(int status) => status switch
    {
        2 => $"{status}Run",
        10100 => $"{status}超时报警",
        10010 => $"{status}电机报警",
        10001 => $"{status}急停拉绳",
        _ => $"{status}未知线体故障"
    };
}
